package com.snj.bestdealer.lib;

import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import android.content.SharedPreferences;

public class Global {
	
	public static String pkgname = "com.snj.bestdealer";
	public static SharedPreferences pref = null;
	
	public static String devicekey = "";
	
	public static String usrname = "";
	public static String usrphone = "";
	public static String usremail = "";
	public static String usrpassword = "";
	public static String usrtype = "";
	public static String usrbrand = "";
	
	public static final String baseurl = "http://snjcommunication.cafe24.com/bd/";
	public static final String versionurl = baseurl + "getversion.php";
	public static final String joinurl = baseurl + "join.php";
	public static final String loginurl = baseurl + "login.php";
	public static final String getvpadurl = baseurl + "getvpad.php";
	public static final String newsurl = baseurl + "getnews.php";
	public static final String getbrandurl = baseurl + "getbrand.php";
	public static final String getmodelurl = baseurl + "getmodel.php";
	public static final String uploaduserpicurl = baseurl + "uploaduserpic.php";
	public static final String requesturl = baseurl + "request.php";
	public static final String requsetlisturl = baseurl + "getconsumerreqlist.php";
	public static final String uploadreqimgurl = baseurl + "uploadreqimg.php";
	public static final String submiturl = baseurl + "submit.php";
	
	public static final String getallrequseturl = baseurl + "getallrequest.php";
	public static final String getmysubmittedrequseturl = baseurl + "getsubmittedreq.php";
	public static final String getreceivedrequseturl = baseurl + "getreceivedreqlist.php";
	public static final String getsubmittedrequseturl = baseurl + "getsubmittedreqlist.php";
	
	
	public static final HashMap<String, Integer> logo_map = new HashMap<String, Integer>();
	public static final HashMap<String, String> pay_map = new HashMap<String, String>();
	
	
	public static boolean isValidEmail(String email) {
		boolean err = false;
		String regex = "^[_a-z0-9-]+(.[_a-z0-9-]+)*@(?:\\w+\\.)+\\w+$";

		Pattern p = Pattern.compile(regex);
		Matcher m = p.matcher(email);
		if( !m.matches() ) {
		    err = true; 
		}
		return err;
	}
}


